<template>
	<view class="pr">
		<image src="/static/img/my/bg.png" class="w-max pa top0 left0" style="max-height: 100%;" mode="widthFix" />
		<u-navbar :is-back="false" :border-bottom="false" title="我的" titleBold :is-fixed="false"
			:background="{ background: '#0000' }">
			<view class="pl20 pr20 flex row-between w-max">
				<view class=""></view>
				<!-- <view class="" @click="$jump('./set/set')">
					<image src="/static/img/my/set.png" class="w46 h46" mode="" />
				</view> -->
			</view>
		</u-navbar>
		<kefu />
		<view class="pr p30 z-index2 top0">
			<view class="flex mb30">
				<view class="w108 h108 p4 radius bg-fff">
					<view class="" @click="$jump('./set/userInfo')">
						<u-avatar size="100" :src="$user.avatar_img || ''" :showSex="!!$user.sex"
							:sex-icon="$user.sex == 2 ? 'man' : $user.sex == 1 ? 'woman' : ''" />
					</view>
				</view>
				<view class="pl24">
					<view class="fw-w fs30">{{ $user.name || "请设置姓名" }}</view>
					<view class="mt10">ID：{{ $user.id || '' }}</view>
				</view>
			</view>
			<view class="flex mb30">
				<view class="bg-f8f h148 radius12 box-shadow w50p flex"
					@click="$jump('/pages/my/addPatient/patientList')">
					<image src="/static/img/my/1.png" class="h104 w104" mode=""></image>
					<view class="pl44 ">
						<view class="fs28">
							就诊人
						</view>
						<view class="fs30 fw-600 mt16">{{ $user.patient_num || 0 }}</view>
					</view>
				</view>
				<view class="bg-f8f h148 radius12 box-shadow w50p ml20 flex"
					@click="$jump('/pages/my/coupon/coupon', { show: 1 })">
					<image src="/static/img/my/2.png" class="h104 w104" mode=""></image>
					<view class="pl10">
						<view class="">
							<text class="fs28">优惠券</text>
							<text class="fs24 color-999">(未使用)</text>
						</view>
						<view class="color-fs fw-700 mt16">{{ $user.coupon_num || 0 }}
						</view>
					</view>
				</view>
			</view>
			<view class="box-shadow mb30" v-if="banner">
				<u-swiper :list="banner || []" height="140" name="pic" @click="$jumps(banner[$event])" />
			</view>
			<view class="fw-w fs32 mb20" style="color: var(--color);">常用工具</view>
			<view class=" radius16 flex flex-wrap tc fs26 mb30">
				<view class="pt30 pb30 w25p" @click="$jump(item.url)" v-for="(item, index) in mylist" :key="index">
					<image :src="item.icon" class="w84 h84" mode=""></image>
					<view class="mt14 ">{{ item.name }}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				banner: '',
				mylist: [{
						name: '我的地址',
						icon: '/static/img/my/address.png',
						url: '/pages/my/address/address'
					}, {
						name: '我的钱包',
						icon: '/static/img/my/wdqb.png',
						url: '/pages/my/balance/balance'
					},
					// {
					// 	name: '邀请好友',
					// 	icon: '/static/img/my/yqhy.png',
					// 	url: '/pages/my/menu/invite'
					// },
					{
						name: '我的评价',
						icon: '/static/img/my/evaluate.png',
						url: '/pages/my/menu/my_evaluate'
					},
					{
						name: '我的分销',
						icon: '/static/img/my/wdfx.png',
						url: '/pages/my/menu/performance'
					}, {
						name: '意见反馈',
						icon: '/static/img/my/yjfk.png',
						url: '/pages/my/menu/feedback'
					}, {
						name: '合伙人加入',
						icon: '/static/img/my/hhrjr.png',
						url: '/pages/my/menu/applyFor?type=partner'
					},
					{
						name: '申请陪诊师',
						icon: '/static/img/my/sqpzs.png',
						url: '/pages/my/menu/applyFor?type=master'
					},
					{
						name: '设置',
						icon: '/static/img/my/my_set.png',
						url: '/pages/my/set/set'
					},
					// {
					// 	name: '申请专业护士',
					// 	icon: '/static/img/my/sqhs.png',
					// 	url: '/pages/my/menu/applyFor?type=nurse'
					// },
				],
			};
		},
		onShow() {
			this.$getUser()
		},
		onLoad() {
			this.getBanner()
		},
		onPageScroll: function(e) {
			this.scrollTop = e.scrollTop
		},
		methods: {
			click(item) {
				item.methods ? item.methods() : this.$jump(item.url, item.params)
			},
			getBanner() {
				this.$request('/member/my/advertBanner').then(res => {
					this.banner = res.data
				})
			},
		}
	}
</script>

<style lang="scss">
	// page {
	// 	// background: #f0f2f5;
	// }
</style>